MkDocStrings
Docstring section (powered by mkdocstrings).¶
Example: DocStrings¶
Bases: MkNode
Docstring section (powered by mkdocstrings).
REQUIRED_PACKAGES
class-attribute
instance-attribute
¶
REQUIRED_PACKAGES = [Package('mkdocstrings', extras=['python'])]
__init__
¶
__init__(
obj: (
ModuleType
| Object
| str
| tuple[str, ...]
| list[str]
| PathLike
| type
| Callable
),
for_topmost: bool = True,
allow_inspection: bool | None = None,
show_bases: bool | None = None,
show_source: bool | None = None,
preload_modules: list[str] | None = None,
heading_level: int | None = None,
show_root_heading: bool | None = None,
show_root_toc_entry: bool | None = None,
show_root_full_path: bool | None = None,
show_root_members_full_path: bool | None = None,
show_object_full_path: bool | None = None,
show_category_heading: bool | None = None,
show_symbol_type_heading: bool | None = None,
show_symbol_type_toc: bool | None = None,
show_docstring_description: bool | None = None,
inherited_members: bool | None = None,
members: list[str] | None = None,
members_order: Literal["alphabetical", "source"] | None = None,
filters: list[str] | None = None,
group_by_category: bool | None = None,
show_submodules: bool | None = None,
docstring_section_style: Literal["table", "list", "spacy"] | None = None,
merge_init_into_class: bool | None = None,
show_if_no_docstring: bool | None = None,
annotations_path: Literal["brief", "source"] | None = None,
line_length: int | None = None,
show_signature: bool | None = None,
show_signature_annotations: bool | None = None,
signature_crossrefs: bool | None = None,
separate_signature: bool | None = None,
**kwargs: Any
)
Docstring section.
Global options for DocStrings can be overridden by setting the keyword arguments to not-None.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
ModuleType | Object | str | tuple[str, ...] | list[str] | PathLike | type | Callable
|
What to show DocStrings for. |
required |
for_topmost
|
bool
|
If True, try to find the "shortest" path to given object by checking whether it can also be found in a parent module. |
True
|
allow_inspection
|
bool | None
|
Whether to allow inspecting modules when visiting them is not possible |
None
|
show_bases
|
bool | None
|
Show the base classes of a class. |
None
|
show_source
|
bool | None
|
Show the source code of this object. |
None
|
preload_modules
|
list[str] | None
|
List of modules to pre-load. |
None
|
heading_level
|
int | None
|
The initial heading level to use. |
None
|
show_root_heading
|
bool | None
|
Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after :::). |
None
|
show_root_toc_entry
|
bool | None
|
If the root heading is not shown, at least add a ToC entry for it. |
None
|
show_root_full_path
|
bool | None
|
Show the full Python path for the root object heading. |
None
|
show_root_members_full_path
|
bool | None
|
Show the full Python path of the root members. |
None
|
show_object_full_path
|
bool | None
|
Show the full Python path of every object. |
None
|
show_category_heading
|
bool | None
|
When grouped by categories, show a heading for each category. |
None
|
show_symbol_type_heading
|
bool | None
|
Show the symbol type in headings (e.g. mod, class, func and attr). |
None
|
show_symbol_type_toc
|
bool | None
|
Show the symbol type in the Table of Contents (e.g. mod, class, func and attr). |
None
|
show_docstring_description
|
bool | None
|
Whether to show the description from DocStrings |
None
|
inherited_members
|
bool | None
|
Also show inherited members. |
None
|
members
|
list[str] | None
|
An explicit list of members to render. |
None
|
members_order
|
Literal['alphabetical', 'source'] | None
|
The members ordering to use. |
None
|
filters
|
list[str] | None
|
A list of filters applied to filter objects based on their name. A filter starting with ! will exclude matching objects instead of including them. The members option takes precedence over filters (filters will still be applied recursively to lower members in the hierarchy). |
None
|
group_by_category
|
bool | None
|
Group the object's children by categories: attributes, classes, functions, and modules. |
None
|
show_submodules
|
bool | None
|
When rendering a module, show its submodules recursively. |
None
|
docstring_section_style
|
Literal['table', 'list', 'spacy'] | None
|
The style used to render docstring sections. |
None
|
merge_init_into_class
|
bool | None
|
Whether to merge the init method into the class' signature and docstring. |
None
|
show_if_no_docstring
|
bool | None
|
Show the object heading even if it has no docstring or children with docstrings. |
None
|
annotations_path
|
Literal['brief', 'source'] | None
|
The verbosity for annotations path |
None
|
line_length
|
int | None
|
Maximum line length when formatting code/signatures. |
None
|
show_signature
|
bool | None
|
Show methods and functions signatures. |
None
|
show_signature_annotations
|
bool | None
|
Show the type annotations in methods and functions signatures. |
None
|
signature_crossrefs
|
bool | None
|
Whether to render cross-references for type annotations in signatures. |
None
|
separate_signature
|
bool | None
|
Whether to put the whole signature in a code block below the heading. If Black is installed, the signature is also formatted using it. |
None
|
kwargs
|
Any
|
Keyword arguments passed to super. |
{}
|
Bases: MkNode
__init__
¶
__init__(
obj: (
ModuleType
| Object
| str
| tuple[str, ...]
| list[str]
| PathLike
| type
| Callable
),
for_topmost: bool = True,
allow_inspection: bool | None = None,
show_bases: bool | None = None,
show_source: bool | None = None,
preload_modules: list[str] | None = None,
heading_level: int | None = None,
show_root_heading: bool | None = None,
show_root_toc_entry: bool | None = None,
show_root_full_path: bool | None = None,
show_root_members_full_path: bool | None = None,
show_object_full_path: bool | None = None,
show_category_heading: bool | None = None,
show_symbol_type_heading: bool | None = None,
show_symbol_type_toc: bool | None = None,
show_docstring_description: bool | None = None,
inherited_members: bool | None = None,
members: list[str] | None = None,
members_order: Literal["alphabetical", "source"] | None = None,
filters: list[str] | None = None,
group_by_category: bool | None = None,
show_submodules: bool | None = None,
docstring_section_style: Literal["table", "list", "spacy"] | None = None,
merge_init_into_class: bool | None = None,
show_if_no_docstring: bool | None = None,
annotations_path: Literal["brief", "source"] | None = None,
line_length: int | None = None,
show_signature: bool | None = None,
show_signature_annotations: bool | None = None,
signature_crossrefs: bool | None = None,
separate_signature: bool | None = None,
**kwargs: Any
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
ModuleType | Object | str | tuple[str, ...] | list[str] | PathLike | type | Callable
|
What to show DocStrings for. |
required |
for_topmost
|
bool
|
If True, try to find the "shortest" path to given object by checking whether it can also be found in a parent module. |
True
|
allow_inspection
|
bool | None
|
Whether to allow inspecting modules when visiting them is not possible |
None
|
show_bases
|
bool | None
|
Show the base classes of a class. |
None
|
show_source
|
bool | None
|
Show the source code of this object. |
None
|
preload_modules
|
list[str] | None
|
List of modules to pre-load. |
None
|
heading_level
|
int | None
|
The initial heading level to use. |
None
|
show_root_heading
|
bool | None
|
Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after :::). |
None
|
show_root_toc_entry
|
bool | None
|
If the root heading is not shown, at least add a ToC entry for it. |
None
|
show_root_full_path
|
bool | None
|
Show the full Python path for the root object heading. |
None
|
show_root_members_full_path
|
bool | None
|
Show the full Python path of the root members. |
None
|
show_object_full_path
|
bool | None
|
Show the full Python path of every object. |
None
|
show_category_heading
|
bool | None
|
When grouped by categories, show a heading for each category. |
None
|
show_symbol_type_heading
|
bool | None
|
Show the symbol type in headings (e.g. mod, class, func and attr). |
None
|
show_symbol_type_toc
|
bool | None
|
Show the symbol type in the Table of Contents (e.g. mod, class, func and attr). |
None
|
show_docstring_description
|
bool | None
|
Whether to show the description from DocStrings |
None
|
inherited_members
|
bool | None
|
Also show inherited members. |
None
|
members
|
list[str] | None
|
An explicit list of members to render. |
None
|
members_order
|
Literal['alphabetical', 'source'] | None
|
The members ordering to use. |
None
|
filters
|
list[str] | None
|
A list of filters applied to filter objects based on their name. A filter starting with ! will exclude matching objects instead of including them. The members option takes precedence over filters (filters will still be applied recursively to lower members in the hierarchy). |
None
|
group_by_category
|
bool | None
|
Group the object's children by categories: attributes, classes, functions, and modules. |
None
|
show_submodules
|
bool | None
|
When rendering a module, show its submodules recursively. |
None
|
docstring_section_style
|
Literal['table', 'list', 'spacy'] | None
|
The style used to render docstring sections. |
None
|
merge_init_into_class
|
bool | None
|
Whether to merge the init method into the class' signature and docstring. |
None
|
show_if_no_docstring
|
bool | None
|
Show the object heading even if it has no docstring or children with docstrings. |
None
|
annotations_path
|
Literal['brief', 'source'] | None
|
The verbosity for annotations path |
None
|
line_length
|
int | None
|
Maximum line length when formatting code/signatures. |
None
|
show_signature
|
bool | None
|
Show methods and functions signatures. |
None
|
show_signature_annotations
|
bool | None
|
Show the type annotations in methods and functions signatures. |
None
|
signature_crossrefs
|
bool | None
|
Whether to render cross-references for type annotations in signatures. |
None
|
separate_signature
|
bool | None
|
Whether to put the whole signature in a code block below the heading. If Black is installed, the signature is also formatted using it. |
None
|
kwargs
|
Any
|
Keyword arguments passed to super. |
{}
|
Name | Children | Inherits |
---|---|---|
MkNode mknodes.basenodes.mknode Base class for everything which can be expressed as Markup. |
graph TD
94721311752256["_mkdocstrings.MkDocStrings"]
94721308848336["mknode.MkNode"]
94721311766592["node.Node"]
140564252373184["builtins.object"]
94721308848336 --> 94721311752256
94721311766592 --> 94721308848336
140564252373184 --> 94721311766592
[metadata]
icon = "mdi:api"
name = "MkDocStrings"
group = "documentation"
[requirements.plugin.mkdocstrings]
[requirements.package.mkdocstrings]
extras = "python"
[examples.docstrings]
title = "DocStrings"
jinja = """
{{ "mknodes.MkDocStrings" | MkDocStrings(show_if_no_docstring=True, heading_level=3) }}
"""
[output.markdown]
template = """
::: {{ node.obj_path }}
{% if node.options %}
options:
{% for k, v in node.options.items() %}
{{ k }}: {{ v | repr }}
{% endfor %}
{% endif %}
"""
mknodes.basenodes._mkdocstrings.MkDocStrings | |
---|---|
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|